package com.lbb.waimai.controller;

import com.lbb.waimai.entiry.Seller;
import com.lbb.waimai.result.R;
import com.lbb.waimai.service.SellerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RequestMapping("seller")
@RestController
public class SellerController {

    @Autowired
    private SellerService sellerService;

    //获取商家信息
    @GetMapping("findSeller")
    public R findSeller(Integer id) {
        Seller seller = sellerService.getById(id);
        return R.ok().data("data", seller);
    }
}
